StoredLearningSession.Start Method (bool)

Start the attempt associated with this session.

Parent Type: StoredLearningSession

Namespace: Microsoft.LearningComponents.Storage

Assembly: Microsoft.LearningComponents.Storage.dll

Syntax
C#

public void Start (
bool ensureInitialActivity

)

Parameters

ensureInitialActivity

If true, this method will attempt to select an initial activity for delivery even if the default sequencing rules in the package do not select one. If false, only the sequencing rules within the package will be used to attempt to select an initial activity for the session. If this does not result in identifying an activity for delivery, the application will need to select one using the MoveToActivity method in order to start the session.

Exceptions
Exception type Condition
InvalidOperationException

Thrown if the attempt is not active (that is, AttemptStatus is not AttemptStatus.Active, or if the attempt has already started.

InvalidPackageException

Thrown if

ensureInitialActivity

is true and an activity cannot be identified for delivery. This indicates the package cannot be attempted.

SequencingException

Thrown if the application passes ensureInitialActivity as false, indicating only the sequencing rules should be used to determine the first activity, and an initial activity cannot be identified. In this case, the attempt has not started and the application will need to select an activity and start the attempt using the MoveToActivity method.

Remarks

In order to navigate within a session, the attempt must be started. An attempt is started when the first activity is identified for delivery.

This method does not save the state of the session. The application should call CommitChanges after calling this method and before disposing the session object to save the session state in long-term storage.

If the application passes ensureInitialActivity as true, indicating the session will attempt to determine the first activity even if the sequencing rules do not identify one, and an initial activity cannot be identified, then the package cannot be attempted since there is no way to identify an initial activity.